package skewreduce.framework.physical;

import skewreduce.lib.ITuple;
import skewreduce.lib.ITuple.Type;

public final class Pair<KEY, VAL extends ITuple> implements ITuple {
    KEY key;
    VAL value;

    Pair(KEY k,VAL v) { key = k; value = v; }

	@Override
	public int arity() {
		return value.arity();
	}

	@Override
	public boolean equals(ITuple o) {
		return value.equals(o);
	}

	@Override
	public double getDouble(int i) {
		return value.getDouble(i);
	}

	@Override
	public float getFloat(int i) {
		return value.getFloat(i);
	}

	@Override
	public int getInt(int i) {
		return value.getInt(i);
	}

	@Override
	public long getLong(int i) {
		return value.getLong(i);
	}

	@Override
	public String getString(int i) {
		return value.getString(i);
	}

	@Override
	public Type getType(int i) {
		return value.getType(i);
	}

	@Override
	public Object getValue(int i) {
		return value.getValue(i);
	}
	
	public KEY getKey() { return key; }
	public VAL getValue() { return value; }
}